<template>
  <div class="not-found">
    <img 
      src="https://img1.baidu.com/it/u=2662682505,1738248369&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500" 
      alt="404"
      class="not-found__image"
    >
    <h2 class="not-found__title">页面不存在</h2>
    <p class="not-found__description">您访问的页面可能已被删除或移动</p>
    <router-link to="/" class="not-found__button">返回首页</router-link>
  </div>
</template>

<script setup>
import { onMounted } from 'vue'
import { useRouter } from 'vue-router'

const router = useRouter()

onMounted(() => {
  // 3秒后自动跳转到根路径（路由会自动重定向到合适页面）
  setTimeout(() => {
    router.push('/')
  }, 3000)
})
</script>

<style lang="scss" scoped>
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  background-color: #f5f5f5;
  
  &__image {
    width: 20rem;
    height: 20rem;
    margin-bottom: 2rem;
  }
  
  &__title {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 600;
  }
  
  &__description {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.5;
  }
  
  &__button {
    padding: 12px 30px;
    font-size: 1.1rem;
    background-color: #1865ad;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    
    &:hover {
      background-color: #0e6cb9;
      transform: translateY(-2px);
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
    
    &:active {
      transform: translateY(0);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
  }
}
</style>
  